/**
 * Created by meiyun1 on 2017/8/2.
 */
import engine from 'store/src/store-engine'
import localStorage from 'store/storages/localStorage'
import expirePlugin from 'store/plugins/expire'
import defaults from 'store/plugins/defaults'
const store = engine.createStore(
  [
    localStorage
  ],
  [
    defaults,
    expirePlugin
  ]
)
export default {
  get (key) {
    return store.get(key)
  },
  set (key, value, expire) {
    if (expire) {
      store.set(key, value, expire)
    } else {
      store.set(key, value)
    }
  },
  remove (key) {
    store.remove(key)
  },
  clearAll () {
    store.clearAll()
  }
}
